// 不合格处理
import { getAction, deleteAction, putAction, putparamsAction, postAction, httpAction } from '@/api/manage'

// 不合格待处理
const unqualifiedOptionList = (params) => getAction('/jksaas-produce/produce/unqualifiedProcess/unqualifiedPendingProcess/queryByPage', params)
const unqualifiedOptionAdd = (params) => postAction('/jksaas-produce/produce/produce/unqualifiedProcess/unqualifiedPendingProcess/add', params)
const unqualifiedOptionHandle = (params) => postAction('/jksaas-produce/produce/unqualifiedProcess/unqualifiedPendingProcess/deal', params)
const unqualifiedOptionDetail = (id) => getAction(`/jksaas-produce/produce/unqualifiedProcess/unqualifiedPendingProcess/${id}`)
const flowableModelDatas = (params) => getAction(`/jksaas-produce/produce/proc/model/lineInfo`, params)
const getRepairProcess = (params) => getAction(`/jksaas-produce/produce/unqualifiedProcess/unqualifiedHandlingOrder/getRepairProcess`, params)

// 不合格处理单
const unqualifiedProcessList = (params) => getAction('/jksaas-produce/produce/unqualifiedProcess/unqualifiedHandlingOrder/queryByPage', params)
const unqualifiedProcessDel = (id) => deleteAction(`/jksaas-produce/produce/unqualifiedProcess/unqualifiedHandlingOrder/${id}`)
const unqualifiedProcessDetail = (id) => getAction(`/jksaas-produce/produce/unqualifiedProcess/unqualifiedHandlingOrder/${id}`)
// const unqualifiedProcessWithdraw = (params) => getAction(`/jksaas-produce/produce/produceReceiveMaterial/withdraw`,params) // 撤回

// 通过不同处理方式获得处理记录
const unqualifiedHandlingOrderRecords = (params) => getAction(`/jksaas-produce/produce//unqualifiedProcess/unqualifiedHandlingOrder/getRecords`,params) // 撤回

// 查询不合格处理、不合格待处理、检化验申请、检化验单的工序下拉
const getProcessSelects = (params) => getAction('/jksaas-produce/produce/quality/getProcess', params)
const getProcessList = (params) => getAction('/jksaas-produce/produce/quality/processStatistics/getProcessList', params)
const getSumNum = (params) => postAction('/jksaas-produce/produce/quality/processStatistics/getSumNum', params)
const getHistogramAndLineData = (params) => postAction('/jksaas-produce/produce/quality/processStatistics/getHistogramAndLineData', params)



export {
  unqualifiedHandlingOrderRecords,
  unqualifiedOptionList,
  unqualifiedOptionAdd,
  unqualifiedOptionHandle,
  unqualifiedOptionDetail,
  flowableModelDatas,
  getRepairProcess,

  unqualifiedProcessList,
  unqualifiedProcessDel,
  unqualifiedProcessDetail,
  // unqualifiedProcessWithdraw
  getProcessSelects,
  getProcessList,
  getSumNum,
  getHistogramAndLineData
}